// src/utils/oss.ts
import OSS from 'ali-oss';

export const createOSSClient = (params) => {
  return new OSS({
    region: params.region,
    endpoint: params.endpoint,
    accessKeyId: params.accessKeyId,
    accessKeySecret: params.accessKeySecret,
    bucket: params.bucket,
    stsToken: params.securityToken, // 关键：STS临时凭证
    secure: true,
    expiration: params.expiration
    // timeout: 120000
  });

  // return new OSS(params);
};
